-- yamato_airship
-- created by xinj
-- 大和丸研究

return {
    canDevelop = function(id)
        local level = SkyRelicFunctionM.getLevel(id);
        -- 玩家的掠夺成功次数
        local robbedNum = ME.user.dbase:query("total_robbed_times", 0);

        -- 需求次数
        local requireNums = {2, 5, 15, 30, 60, 120, 180, 240, 300};
        if robbedNum < requireNums[level+1] then
            return false;
        end

        return true;
    end,

    -- 其它限制
    limitDevelopDesc = function(id)
        local level = SkyRelicFunctionM.getLevel(id);
        -- 玩家的掠夺成功次数
        local robbedNum = ME.user.dbase:query("total_robbed_times", 0);
        -- 需求次数
        local requireNums = {2, 5, 15, 30, 60, 120, 180, 240, 300};

        return string.format(getLocStr("airship_limit_robbed_times"), requireNums[level+1], robbedNum);
    end,

    -- 获取描述
    getDesc = function(desc)
        -- 获取数量
        local level = SkyRelicFunctionM.getLevel(42);
        -- 需要显示下级效果
        level = level + 1;
        local count = FormulaM.invoke("CALC_AIRSHIP_SCRAP_NUM", ME.user, level);

        desc = string.gsub(desc, "{0}", tostring(count));
        return desc;
    end,
};
